import request from '@/utils/request'

export function addRecord(data) {
  return request({
    url: '/juanbusiness/merchant/add',
    method: 'post',
    data
  })
}

export function findRecord(districtId,merchantTypeId,companyName,principalPhone,page,size) {
  return request({
    url: '/juanbusiness/merchant/findPage',
    method: 'get',
    params: {districtId: districtId,merchantTypeId: merchantTypeId,companyName: companyName,principalPhone: principalPhone,page: page,size: size}
  })
}

 export function freezeRecord(id,operateId,freezeById) {
    return request({
      url: '/juanbusiness/merchant/freezeById',
      method: 'put',
      params: { id: id, operateId: operateId,freezeById: freezeById}
    })
  }

  export function detailRecord(id) {
    return request({
      url: '/juanbusiness/merchant/get',
      method: 'get',
      params: {id: id}
    })
  }

  export function getMerchartRecord(districtId, serviceId) {
    return request({
      url: '/juanbusiness/merchant/getMerchartByDidAndSid',
      method: 'get',
      params: {districtId: districtId, serviceId: serviceId}
    })
  }

export function editRecord(data) {
  return request({
    url: '/juanbusiness/merchant/edit',
    method: 'put',
    data
  })
}

export function delRecord(id) {
  return request({
    url: '/juanbusiness/merchant/del',
    method: 'delete',
    params: {id: id}
  })
}
